package cn.xiaolang.function.sort_algorithm;

public abstract class AbstractSort implements ISort {

	public void sortWithMonitor(int[] a) {
		long startTime = System.currentTimeMillis();
		sort(a);
		long endTime = System.currentTimeMillis();

		StringBuffer sbBuffer = new StringBuffer();
		for (int i = 0; i < a.length; i++) {
			sbBuffer.append(a[i]).append(" ");
		}
		sbBuffer.append("\n").append("耗时: ").append(endTime - startTime).append("(ms)");
		System.out.println(sbBuffer.toString());
	}
}
